package com.codebattery.domain.model;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.Date;
import java.util.List;

/**
 * @Author cay91
 * @Date 2020-09-06 5:59 PM
 * @Version 1.0
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Cart implements Serializable {
    private Integer userId;
    private Integer amount = 0; //数量
    private BigDecimal price = new BigDecimal(0.00);    //价格
    private Date createTime;    //创建购物车时间
    private Date updateTime;    //最后修改时间

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class CartItem implements Serializable {
        private Integer goodsId;    //商品ID
        private String goodsName;   //商品名称
        private Integer amount;  //加入购物车商品数量
        private BigDecimal price;   //商品价格
        private String img; //商品图片
        private String meal;    //套餐
        private Date addTime;   //加入购物车时间
        private Date updateTime;
    }

    private List<CartItem> items;
}
